package com.jiyun.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jiyun.entity.User;
import com.jiyun.mapper.UserMapper;
import com.jiyun.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 聪哥哥
 * @since 2023-05-05
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Autowired
    UserMapper userMapper;


    @Override
    public Page<UserVo> findPage(Integer page, Integer pageSize, UserVo userVo) {
        Page<UserVo> userVoPage = new Page<>(page, pageSize);
        userMapper.findPage(userVoPage,userVo);
        return userVoPage;
    }

    @Override
    public List<UserVo> findAllUserVo() {
        return userMapper.findAllUserVo();
    }

    @Override
    public List<User> findAllUser(Integer rid) {
        return userMapper.findAllUser(rid);
    }

    @Override
    public List<User> findAllUser4Choose(Integer rid) {
        return userMapper.findAllUser4Choose(rid);
    }
}
